package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class IntervalFactor implements IntervalTerm {

    private int beginIndex;
    private int endIndex;
    private Sign sign;
    private IntervalPrimary intervalPrimary;

    public IntervalFactor(Sign sign, IntervalPrimary intervalPrimary) {
        this.beginIndex = sign != null ? sign.getBeginIndex() : intervalPrimary.getBeginIndex();
        this.endIndex = intervalPrimary.getEndIndex();
        this.sign = sign;
        this.intervalPrimary = intervalPrimary;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public Sign getSign() {
        return sign;
    }

    public IntervalPrimary getIntervalPrimary() {
        return intervalPrimary;
    }

}
